9000 PRINT "Vxref",TIME$:DEF SEG:B=PEEK(47)*256+PEEK(46)
9010 DEFSTR M-Z:DEFINT I-L:H=VARPTR(#1)+51:POKE H,6
9020 FOR I=H+1 TO H+252:POKE I,1:NEXT
9030 POKE I,0:POKE I+1,0:POKE I+2,0
9040 FOR I=H+11 TO H+14:POKE I,2:NEXT:POKE I,0
9050 FOR J=H+65 TO H+90:POKE J,3:NEXT
9060 POKE H+132,6:POKE H+143,6:POKE H+28,2:POKE H+29,4
9070 POKE H+31,8:POKE H+34,5:POKE H+209,9:POKE H+176,7
9080 N="ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789$!#%."
9090 U="ACCESS AS     ALL    APPEND BASE   "
9100 V="OUTPUT RANDOM SEG    SHARED ":E=0:K=0:L=0:F=0
9110 Z=SPACE$(255):Y=Z:D=B:B=PEEK(49)*256+PEEK(48):C=B
9120 DIM X(255),H(255),A(255)
9130 E=VARPTR(A(255)):E=E-(E<0)*65536!+16:A(0)=D:J=0
9140 H(0)=PEEK(B+1)*256+PEEK(B):B=B+3:C=PEEK(B)*256+PEEK(B-1)
9150 IF C<A(0) THEN PRINT C;:LOCATE ,1:C=B:G=E:L=0 ELSE 9420
9160 B=B+1
9170 K=PEEK(B):F=F-(K=44)
9180 IF K=58 OR K=133 THEN L=0:F=0 ELSE IF K=41 THEN F=0
9190 K=PEEK(H+PEEK(B))
9200  ON K GOTO 9160,9250,9270,9250,9230,9240,9220,9250,9260
9210 B=B+2:GOTO 9170
9220 L=1:GOTO 9160
9230 B=B+1:IF PEEK(B)=34 THEN 9160 ELSE IF PEEK(B) THEN 9230
9240 B=H(0):GOTO 9140
9250 B=B+PEEK(H+PEEK(B))+1:GOTO 9170
9260 LSET Z="FN":B=B+1:I=3:GOTO 9280
9270 LSET Z=CHR$(PEEK(B)):B=B+1:I=2
9280 WHILE INSTR(N,CHR$(PEEK(B)))
9290  MID$(Z,I)=CHR$(PEEK(B)):I=I+1:B=B+1:WEND
9300  IF PEEK(B)=40 THEN MID$(Z,I)="(":I=I+1:B=B+1:GOTO 9330
9310  IF INSTR(U,LEFT$(Z,7))+INSTR(V,LEFT$(Z,7)) THEN 9170
9320  IF INSTR("B  BF ",LEFT$(Z,3)) THEN IF L+F=3 THEN 9170
9330 IF X(J)=LEFT$(Z,I) THEN 9170
9340  J=INSTR(Y,LEFT$(Z,1)):IF J=0 THEN 9390
9350 IF X(J)=LEFT$(Z,I) THEN D=E-3 ELSE 9380
9360 IF PEEK(D)=J THEN 9170
9370  IF D>G THEN D=D-3:GOTO 9360 ELSE 9400
9380 J=INSTR(J+1,Y,LEFT$(Z,1)):IF J THEN 9350
9390 J=INSTR(Y," "):X(J)=LEFT$(Z,I):H(J)=E:MID$(Y,J,1)=Z
9400 A(J)=E:POKE E,J:POKE E+1,PEEK(C-1)
9410  POKE E+2,PEEK(C):E=E+3:GOTO 9170
9420 D=INSTR(Y," ")-1
9430 FOR I=1 TO D:MID$(X(I),LEN(X(I)))=CHR$(I):NEXT:I=D/2
9440 WHILE I:FOR H=1 TO I:B=1:WHILE B:B=0
9450 FOR J=H TO D-I STEP I
9460  IF X(J)>X(J+I) THEN B=J+I ELSE 9480
9470  SWAP X(J),X(B):SWAP H(J),H(B):SWAP A(J),A(B)
9480 NEXT:WEND:NEXT:I=I\2:WEND
9490 FOR H=1 TO D:PRINT LEFT$(X(H),LEN(X(H))-1);" ";
9500  I=ASC(RIGHT$(X(H),1))
9510 FOR B=H(H) TO A(H) STEP 3
9520  IF PEEK(B)=I THEN PRINT PEEK(B+2)*256+PEEK(B+1);
9530 NEXT:PRINT:NEXT:PRINT D,TIME$:END
